package org.bdware.irs.backend.servicesImpl;

import org.bdware.irs.backend.dto.User;
import org.bdware.irs.backend.services.GrsUserService;
import org.springframework.stereotype.Service;


@Service
public class GrsUserServiceRocksImpl implements GrsUserService {

    @Override
    public void save(User user) {

    }

    @Override
    public void update(User user) {

    }

    @Override
    public User getUser(String doi) {
        if("admin".equals(doi)){
            User user = new User();
            user.setDoi(doi);
            user.setPublicKey("{\"kty\":\"EC\",\"d\":\"koiB0_ffLlbOwxydk9yjXjwaNq-wYLq6QO1Ee9g94-I\",\"use\":\"sig\",\"crv\":\"P-256\",\"kid\":\"123456\",\"x\":\"7MTAnpNwyPnTTe54C0rtPB28OyZ1ZZz87VFqil3t59s\",\"y\":\"l72E_htBfwUXVAqF9De6yr_s9fr9Hp9v3d3ArssI_dk\",\"alg\":\"ES256\"}");
            return user;
        }else{
            return null;
        }
    }
}
